import { lazy } from "react";
import {Navigate} from "react-router-dom"
const Home = lazy(() => import('../pages/Home/Home'))
const Liste = lazy(() => import('../pages/Liste/Liste'))
const Data1 = lazy(() => import('../pages/Data1/Data1'))
const Data2 = lazy(() => import('../pages/Data2/Data2'))
const Mages = lazy(()=>import('../pages/Mages/index'))

export const routes = [
    {
        path: '/mages/home',
        element: <Home></Home>
    },
    {
        path: '/mages/liste',
        element: <Liste></Liste>
    },
    {
        path: '/mages/data1',
        element: <Data1></Data1>
    },
    {
        path: '/mages/data2',
        element: <Data2></Data2>
    }
]

const listData=[
    {
        path:"",
        element:<Navigate to={'/mages'}></Navigate>
    },
    {
        path:"/mages",
        element:<Mages></Mages>,
        children:routes
    }
]
export default listData